<extend name="Common:grid"/>
<!-- 
 ------------------------------------------------------
 图片列表页面
 ------------------------------------------------------
 -->
 <block name="beforeGrid">
//取得管理组字符串
var albums=null;
if(isEmpty(albums)){
	albums=getJqgridStringData(BASE+"/admin/manage/key_value","album");
}
</block>
<block name="extOptions">
$.extend(defaultJqGridOptions,{
	colModel:[   
		{name:"id",index:"id",width:60,sortable:true,editable:false,search:true,searchoptions:{sopt:["eq","ne","gt","lt","le","ge"]}},
		{name:"aid",index:"aid",width:80,align:"left",sortable:true,editable:true,edittype:"select",
			editoptions:{value:albums},formatter:"select",search:true,stype:"select",searchoptions:{value:albums,sopt:["eq","ne"]}},
		{name:"uid",index:"uid",width:80,align:"center",sortable:true,editable:false,search:true,searchoptions:{sopt:["eq","ne","gt","lt","le","ge"]}},
	    {name:"name",index:"name",width:100,align:"left",sortable:false,editable:true,editrules:{required:true},search:true,searchoptions:{sopt:["eq","ne","bw","ew","cn"]},formoptions:{elmsuffix:"&nbsp;*"}},
	    {name:"size",index:"size",width:80,align:"right",sortable:true,editable:false,search:true,searchoptions:{sopt:["eq","ne","gt","lt","le","ge"]}},
	    {name:"description",index:"description",width:120,align:"left",sortable:false,editable:true,edittype:"textarea",search:true,searchoptions:{sopt:["bw","ew","cn"]}},
	    {name:"dateline",index:"dateline",width:70,align:"center",sortable:false,editable:false,formatter:"date",
			formatoptions:{srcformat:"u",newformat:"Y-m-d"},
			search:true,searchoptions:{sopt:["eq","ne","gt","lt","le","ge"],dataInit:function(e){initTime(e)}}},
		{name:"big",index:"big",hidden:true,fix:true,frozen:true,editable:false,viewable:false,search:false},
		{name:"more",width:60,align:"center",sortable:false,editable:false,formatter:actionLinksFormatter,
			formatoptions:{
				items:[{
						title:"查看大图",
						onclick:"viewImg(this);",
						className:"ui-icon-image"
					}]
				}
			,search:false
		}
	],
	rownumbers:false,
	rowList:[20,40]
});
$.extend(defaultPagerVisiableOptions,{"search":true,"add":false});
</block>

<block name="extFunction">
function viewImg(link){
	var tid=$(link).attr("rowId");
	var table=$("#{$layout}_{$Think.ACTION_NAME}_table");
	table.jqGrid('setSelection',tid);
	var row=table.getRowData(tid);
	var htm="<div style='width:620px;height:500px;text-align:center;'><img  src='"+row.big+"'/></div>";
	var title=row.title;
	if(isEmpty(title)){
		title="幻灯图片";
	}
	var link=row.link;
	if(!isEmpty(link)){
		htm="<a href='"+link+"' target='_blank'>"+htm+"</a>"
	}
	var dialog=artDialog(htm,title);
}
</block>